import request from "../utils/request";
const API = {
    GETSTUDENT: 'students',
    DELETESTUDENT:'students',
    ADDSTUDENT:'students',
    GETSTUDENTBYID:'students',
    UPDATESTUDENT:'students'

}
//增加学生 "data:{  "name": "王五", "age": 16,"gender": "女","address": "武汉"}" 
export const reqAddStudent=(data)=>{ 
    const stuData={data:data}
    request.post(API.ADDSTUDENT,stuData)}
   
//删除学生
export const reqDeleteStudent=(stuId)=>request.delete(`${API.DELETESTUDENT}/${stuId}`)
//获取所有学生
export const reqStudentsData = () => request.get(API.GETSTUDENT)
//根据id获取学生
export const reqGetStuById=(stuId)=>request.get(`${API.GETSTUDENTBYID}/${stuId}`)
//修改学生信息
export const reqUpdateStudent=(stuId)=>request.put(`${API.UPDATESTUDENT}/${stuId}`)

